package br.com.gerador.main;

import java.awt.Button;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

import br.com.gerador.component.DivComponent;
import br.com.gerador.component.LabelComponent;

public class PnlInspect extends JPanel {
	private Principal owner;
	public PnlInspect(Principal owner) {
		super(new FlowLayout(FlowLayout.LEFT));
		this.owner = owner;
		setPreferredSize(new Dimension(Short.MAX_VALUE,40));
		setBackground(Color.LIGHT_GRAY);
		setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));
		addButtons();
	}
	
	private void addButtons(){
		Dimension d = new Dimension(30, 30);
		Button bt1 = new Button();
		bt1.setPreferredSize(d);
		add(bt1);
		
		bt1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				owner.setBtnSelected(LabelComponent.class);
			}
		});
		
		
		Button bt2 = new Button();
		bt2.setPreferredSize(d);
		add(bt2);

		bt2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				owner.setBtnSelected(DivComponent.class);
			}
		});

		Button bt3 = new Button();
		bt3.setPreferredSize(d);
		add(bt3);

		Button bt4 = new Button();
		bt4.setPreferredSize(d);
		add(bt4);

		Button bt5 = new Button();
		bt5.setPreferredSize(d);
		add(bt5);
	}
}
